package hfkh.io01;

import java.io.*;

public class DataOutputStream11 {
	public static void main(String[] args) {
		
				DataInput dis=null;
				DataOutputStream dos=null;
				try {
					dis=new DataInputStream(new FileInputStream("d:/Moxie10.class"));
					dos=new DataOutputStream(new FileOutputStream("d:/fileCopy.class"));
					
					int temp;
					while((temp=dis.readByte())!=-1){
						dos.write(temp);
					}
				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}finally{
					if(dis!=null){
						try {
							((FilterOutputStream) dis).close();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
					if(dos!=null){
						try {
							dos.close();
						} catch (IOException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				}
	}

}
